<?php

namespace App\Api\Logic;

use App\Api\Logic\Validate\DistrictValidate;
use App\Exceptions\ValidationException;
use App\Helpers\ResponseEnum;

class DistrictLogic extends BaseLogic
{
    /**
     * @return DistrictValidate
     */
    private function getValidate():DistrictValidate{
        return  new DistrictValidate();
    }

    /**
     * 获取地区
     * @param $params
     * @return void
     * @throws ValidationException
     */
    public function get_district($params)
    {
        $validate = $this->getValidate();
        if (!$validate->scene('getDistrict')->check($params)) {
            throw new ValidationException(ResponseEnum::HTTP_ERROR, $validate->getError());
        }
    }
}
